/**
 * 
 */
package org.xelnaga.defiler.web.servlet.view;

import java.util.Collection;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

/**
 * @author qijb
 *
 */
public class RiotFreeMarkerView extends FreeMarkerView {
	private Collection<ModelPostProcessor> modelPostProcessors;

	public void setModelPostProcessors(Collection<ModelPostProcessor> modelPostProcessors) {
		this.modelPostProcessors = modelPostProcessors;
	}

	@Override
	protected void exposeHelpers(Map<String, Object> model,
			HttpServletRequest request) throws Exception {
		super.exposeHelpers(model, request);
		if (modelPostProcessors != null) {
			for (ModelPostProcessor processor : modelPostProcessors) {
				processor.postProcess(model, request, null);
			}
		}
	}
	
}
